
import com.liubin.hsjc.ServiceFrontApplication;
import com.liubin.hsjc.model.Admin;
import com.liubin.hsjc.model.Order;
import com.liubin.hsjc.model.User;
import com.liubin.hsjc.service.OrderService;
import com.liubin.hsjc.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;



@RunWith(SpringRunner.class)
@SpringBootTest(classes = {ServiceFrontApplication.class})
public class test {
    @Autowired
    private UserService userService;

    @Autowired
    private OrderService orderService;



    @Test
    public void test() {

//        String[] arr = {"王五","赵六","张三","李四"};
//        Integer[] arr1 = {2,3,4,5};
//
//        for (int i = 0; i < 100; i++) {
//            User user = new User();
//            user.setName(arr[i%4]);
//            StringBuilder builder1 = new StringBuilder();
//            for (int j = 0; j < 18; j++) {
//                builder1.append((int)(Math.random()*10));
//            }
//            user.setCertificateId(builder1.toString());
//            StringBuilder builder2 = new StringBuilder();
//            for (int j = 0; j < 11; j++) {
//                builder2.append((int)(Math.random()*10));
//            }
//            user.setPhone(builder2.toString());
//            user.setDistrict(arr1[i%4]);
//            user.setStreet((int)(Math.random()*17 + 57));
//            user.setDetailAddr("张三社区");
//            userService.saveUser(user);


//        String[] arr1 = {"核酸检测(标本混采)","核酸检测(标本单采)"};
//        Integer[] arr2 = {1,2,3,4};
//        Integer[] arr3 = {24,25,26,27,28,29,30};
//        for (int i = 62; i <= 161; i++) {
//            Order order = new Order();
//            order.setItemName(arr1[i%2]);
//            order.setItemNum(1);
//            if(order.getItemName().equals("核酸检测(标本混采)")){
//                order.setPrice(10.0);
//            }else{
//                order.setPrice(40.0);
//            }
//            order.setHospId(arr2[i%4]);
//            order.setUserId(i);
//
//            order.setOrderTime("2022-04-" + arr3[i%7]);
//            order.setTimeId(i%2);
//            order.setStatus(0);
//            order.setOpenId("oUfrV4rKjqnseEgDP8jUDAhAta_Y");
//            orderService.save(order);
//        }

        //管理员用户添加
        for (int i = 3; i <= 89; i++) {
            Admin admin = new Admin();

        }

    }
}
